# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: speps <speps at aur dot archlinux dot org>
# Contributor: Philipp Überbacher <murks at lavabit dot com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: orbisvicis

pkgname=zita-convolver
pkgver=4.0.3
pkgrel=3
pkgdesc="A fast, partitioned convolution engine library."
arch=(loong64 x86_64)
url="https://kokkinizita.linuxaudio.org/linuxaudio/"
license=(GPL3)
depends=(
  fftw
  gcc-libs
  glibc
)
provides=(libzita-convolver.so)
source=(https://kokkinizita.linuxaudio.org/linuxaudio/downloads/$pkgname-$pkgver.tar.bz2)
sha512sums=('62d7841757f10c094e43ed755e187f947c5743f302ed2a1ee6064a850c18921466f4505d8a2a7b3ad23619db7f1ad7307e1dfb2e8a1e7685e60ece2ffff4f6ca')
b2sums=('3bd77cbc46d93c2200329451634dc48b94183aaa17034aa4b3dd03c33ad7982e9bed85e164f5c0e34666a1a6443199afe24222d41477368c4b366335e9767b91')

prepare() {
  # FS#36248 - strip -march=native
  # call ldconfig in local context
  sed -e '/native/d; s/ldconfig/& -N $(DESTDIR)\/$(LIBDIR)/' -i $pkgname-$pkgver/source/Makefile
}

build() {
  make -C $pkgname-$pkgver/source
}

package() {
  make SUFFIX="" PREFIX=/usr DESTDIR="$pkgdir/" install -C $pkgname-$pkgver/source
  install -vDm 644 $pkgname-$pkgver/{AUTHORS,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
